<template>
	<view>
		<view style="display: flex;margin-left: 18rpx;">
			<view class="row" style="height: 180rpx;">
				<view >
					<image :src="userInfo.avatarUrl" style="width: 160rpx;height: 160rpx;"></image>
				</view>
				<view class="row_right">
					<view class="assistant_ly" >
						<text style="flex-direction: inherit;font-size: 40rpx;font-weight: bold;">{{userInfo.name}}</text>
						<text style="flex-direction: inherit;font-size: 30rpx;">简客号：{{userInfo.username}}</text>
					</view>
					
				</view>
			</view>
		</view>
		
		<view>
			<button @click="addApply" style="background-color: #BDB76B;padding-left: 10rpx;">添加到通讯录</button>
		</view>
	</view>
</template>

<script>
	import http from '../../../common/request.js'
	export default {
		onLoad(options){
				this.uid=options.uid
				 this.search(options.uid)
		   },
		data() {
			return {
				userInfo:{},
				uid:undefined
			}
		},
		methods: {
			addApply(){
				uni.navigateTo({
					url:'./apply_add?uid='+this.uid
				})
			},
			
			async search(uid) {
					const res = await http.request({
						url: '/sys_user/friend/'+uid,
						method:'GET',
						data:{}
					})
					if(res.data.code==0){
						this.userInfo = res.data.data
						
					}else{
						uni.showToast({
							title:res.data.data.message
						})
					}				
			},
		}
	}
</script>

<style lang="scss">
	
	.chat_data{
	  border-radius: 5rpx;
	  padding: 1%;
	  margin-top: 2%;
	  width: 90%;
	  margin-left: 5%;
	  margin-right: 5%;
	  display: flex;
	}
	
.chat_header_pic{
  width: 110rpx;
  margin-left: 20rpx;
  height: 110rpx;
  border-radius: 10%;
}

.chat_info_name{
	margin-left: 20rpx;
	margin-top: 30%;
	  float: left;
	  font-weight: bold;
	  font-size: large;
}
.chat_info_msg{
  font-size: x-small;
  color: darkkhaki;
}
.chat_view_pic{
  width: 20%;
}
 page {
   }
   .line{
   	width: 100%;
   	height: 10px;
   }
   .assistant_ly{
     text-align: left;
     display:flex;
     flex-direction:column;
     border-radius: 50rpx;
     background-color: white;
     justify-content: center;
   }


	.line{
		width: 100%;
		height: 10px;
	}
	.row {
		background: white;
		display: flex;
		width: 100%;
		height: 50px;

		.row_logo {
			width: 18%;
			display: flex;
			align-items: center;

			image {
				width: 32px;
				height: 32px;
				margin: auto;
				border-radius: 5px;
			}
		}

		.row_right {
			position: relative;
			height: 100%;
			width: 84%;
			display: flex;
			align-items: center;

			border: {
				bottom: 1px solid #DDDDDD;
			}

			text {
				font-size: 16px;
				font-family: 'syht';
				display: block;
			}
			.icon_right{
				position: absolute;
				right: 10px;
				width: 15px;
				height: 15px;
				opacity: .5;
			}

		}



	}

	.row:last-child {
		.row_right {
			border: 0;
		}
	}
</style>
